﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using imaginecup.util;
using Imaginecup.util.resourceMan;
using Imaginecup.shareData;

namespace Imaginecup.sprite
{
    public class NormalSprite:ISprite
    {
        private String m_TextureName;


        public void SetTextureName(String name)
        {
            m_TextureName = name;
        }

        public void Draw(SpriteBatch spriteBatch, EntityInfo entityInfo)
        {
            Texture2D texture = ResourceMan.GetResourceMan().GetTexture(m_TextureName);
            Vector2 sourceSize = ResourceMan.GetResourceMan().GetFrameSize(m_TextureName);

            spriteBatch.Begin();
            spriteBatch.Draw(texture, new Rectangle((int)entityInfo.mPosition.X, (int)entityInfo.mPosition.Y,
                                                     (int)entityInfo.mSize.X, (int)entityInfo.mSize.Y)
                                    , new Rectangle(0 , 0 , (int)sourceSize.X , (int)sourceSize.Y ) ,
                                    Color.White);
            spriteBatch.End();
        }

        public void Release()
        {
           


        }
        
    }
}
